<%
    Users user = Trader.getUser(request.getParameter("uid"));
	wstrader.task.quality.SampleSent task = user.quality.samplesent;
	String Typ = request.getParameter("sample_type");
	task.getRequest().setRequest(request);
	task.getResponse().setResponse(response,out);
	
	if (!user.Authenticated()) {
		response.sendRedirect("logon.jsp");
		return;
	}
	((Tasks)task.getOwner()).clearFocus();
	task.setFocus(true);	
	Trader.window_width = "90%";	
	long focused_id = task.doTask();
	Record rc   = task.getRecord("sample_master",focused_id);
%>

<%@include file="../header.jsp"%>
<style type="text/css">
<!--
.style6 {
	font-size: 12px;
	font-weight: bold;
	font-family: Arial;
}
.style7 {
	font-family: Arial;
	font-size: 12px;
}
.style14 {font-family: Arial}
.style3 {font-weight: bold}
-->
</style>

<script language="javascript">
function doListView()
{
	var form = document.formMain;
	form.action = "quality.samplesent.jsp";
	form.submit();
}

function new_sample_quality_dts(cat)
{
	var form = document.formMain;
	form.category.value = cat;
	form.new_rec.value=1;
	form.action = "quality.sampleinput.card-view.jsp"
	form.submit();
}

function doUpdate()
{
	var form = document.formMain;
	doTask(1);
}

function newrecord()
{
	var form = document.formMain;
	var value = "<%=task.getNew_SamSentRef()%>";
	var value1 = "New Contract";
	if (addNewListItemById("sample_master",value1) < 0) return;	
	form.rec_id.value = "<%=task.getLastID("sample_master") + 1%>";
	form.sent_received_date.value = "";
	form.ref_number.value = "";
	setValue("ref_number",value);	
	form.attention_to.value = "";
	form.awb_no.value = "";
	form.remarks.value = "";
	form.sample_type.value="S";
}
</script>
<form action="" method="post" name="formMain" id="formMain">
  <table width="100%"  border="0.5" cellspacing="0" cellpadding="0">
    <tr>
      <td colspan="2"><img src="images/samplesent.jpg" width="300" height="30"></td>
    </tr>
    <tr>
      <td colspan="2"><table width="100%"  border="1" cellspacing="0" cellpadding="0">
        <tr>
          <td width="12%" valign="top"><table width="100%"  border="0.5" cellspacing="0" cellpadding="0">
            <tr>
              <td height="28" colspan="2" align="center" bgcolor="#DDDDDD"><span class="style6">Sample Ref.</span></td>
            </tr>
            <tr>
              <td height="28" colspan="2" align="center"><select name="sample_master" size="20" class="style2" id="sample_master" style="width:100%; border:0" onChange="doPost()">
                <%@include file="include/SampleRefNoList.jsp"%>
              </select></td>
            </tr>
            <tr>
              <td width="86%"><img src="images/new.gif" width="15" height="15" onClick="newrecord();"></td>
              <td width="14%">&nbsp;</td>
            </tr>
			
          </table></td>
          <td width="88%" valign="top"><table width="100%"  border="0.5" cellspacing="0" cellpadding="0">
    <tr>
      <td height="28" colspan="2" align="right"><span class="style7">Sample Sent Date </span></td>
      <td width="1%">&nbsp;</td>
      <td width="12%"><input name="sent_received_date" type="text" id="sent_received_date" style="width:145px" value="<%=rc.getDate("sent_received_date")%>"></td>
      <td width="2%" valign="middle"><img src="js/calendar.gif" width="20" height="20" onClick="popUpCalendar(this,'sent_received_date','dd-mmm-yy');"></td>
      <td width="43%" valign="middle">&nbsp;</td>
      <td width="29%"><input type="hidden" name="uid"        id="uid"       value="<%=user.getuid()%>">
        <input type="hidden" name="task_id"    id = "task_id"   value="0">
        <input name="type" type="hidden" id="type" value="0">
        <input name="category" type="hidden" id="category" value="0">        <span class="style3">
        <input name="rec_id" type="hidden" id="rec_id" value="<%=rc.getIntValue("id")%>">
        <input name="sample_type" type="hidden" id="sample_type" value="S">
        <input name="new_rec" type="hidden" id="new_rec" value="0">
        </span></td>
    </tr>
    <tr>
      <td height="28" colspan="2" align="right"><span class="style7">Sample Ref.</span></td>
      <td>&nbsp;</td>
      <td colspan="3" valign="middle"><input name="ref_number" type="text" id="ref_number" style="width:145px" value="<%=rc.getString("ref_number")%>"></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td height="28" colspan="2" align="right"><span class="style7">Sample Sent To </span></td>
      <td>&nbsp;</td>
      <td colspan="3" valign="middle">
	  <select name="buyer_seller_id" id="buyer_seller_id" style="width:145px">
	  	<%
			task.getResponse().setOption(task.getBuyerList());
			task.getResponse().setSelected("buyer_seller_id",rc.getIntValue("buyer_seller_id"));
		%>	  
      </select></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td height="28" colspan="2" align="right"><span class="style7">Attention To. </span></td>
      <td>&nbsp;</td>
      <td colspan="3" valign="middle"><input name="attention_to" type="text" id="attention_to" style="width:145px" value="<%=rc.getString("attention_to")%>"></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td height="28" colspan="2" align="right" class="style7">Courier </td>
      <td>&nbsp;</td>
      <td colspan="3" valign="middle"><input name="forwarder_name" type="text" id="forwarder_name" style="width:145px" value="<%=rc.getString("forwarder_name")%>"></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td height="28" colspan="2" align="right"><span class="style7">AWB No. </span></td>
      <td>&nbsp;</td>
      <td colspan="3" valign="middle"><input name="awb_no" type="text" id="awb_no" style="width:145px" value="<%=rc.getString("awb_no")%>"></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td height="28" colspan="2" align="right"><span class="style7">Remarks</span></td>
      <td>&nbsp;</td>
      <td colspan="3" valign="middle"><input name="remarks" type="text" id="remarks" style="width:145px" value="<%=rc.getString("remarks")%>"></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td colspan="2">&nbsp;</td>
      <td><img src="images/update.gif" width="15" height="15" onClick="doUpdate();"></td>
      <td colspan="3">&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td colspan="2">&nbsp;</td>
      <td>&nbsp;</td>
      <td colspan="3">&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td colspan="2" align="left"><strong></strong><strong><span class="style7">&nbsp;Sample Category</span></strong></td>
      <td>&nbsp;</td>
      <td colspan="3">&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td width="1%" align="right">&nbsp;</td>
      <td width="12%" align="left"><span class="style6">Approval</span></td>
      <td>&nbsp;</td>
      <td colspan="3">&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td colspan="7"><table width="100%"  border="0.5" cellspacing="0" cellpadding="0">
        <tr>
          <td colspan="11"><table width="100%"  border="1" cellspacing="0" cellpadding="0">
            <tr align="center" bgcolor="#DDDDDD">
              <td width="3%" class="style6">Id</td>
              <td width="7%" height="27" class="style6">Location</td>
              <td width="6%" class="style6">Contract No </td>
              <td width="6%" class="style6">Buyer No </td>
              <td width="6%" class="style6">Lot No </td>
              <td width="6%"><span class="style6">Origin</span></td>
              <td width="6%"><span class="style6">Quality</span></td>
              <td width="16%"><span class="style6">Grade</span></td>
              <td width="5%"><span class="style6">Tons</span></td>
              <td width="4%"><span class="style6">Sample Kg </span></td>
              <td width="5%"><span class="style6">App/Rej</span></td>
              <td width="7%"><span class="style6">Controller</span></td>
              <td width="7%"><span class="style6">Date</span></td>
              <td width="11%"><span class="style6">Remarks</span></td>
              <td width="5%" class="style6">Confirm</td>
            </tr>
<%
			int dLoop=0;
			ResultSet Rs = task.fetchSampleCategoryList(1);
			Rs.beforeFirst();
			if (Rs.next()==true)
			{
				Rs.beforeFirst();
				while (Rs.next())
				{
%>
            	<tr class="style7">
              		<td><%=Rs.getInt("id")%></td>
              		<td><%=Rs.getString("location")%></td>
              		<td><%=Rs.getString("contract_ref_no")%></td>
              		<td><%=Rs.getString("buyer_ref_no")%></td>
              		<td><%=Rs.getString("wn_ref_no")%></td>
              		<td><%=task.getFieldValueForId("origin_master","name",Rs.getInt("origin_id"))%></td>
              		<td><%=task.getFieldValueForId("quality_master","name",Rs.getInt("quality_id"))%></td>
              		<td><%=task.getFieldValueForId("grade_master","name",Rs.getInt("grade_id"))%></td>
              		<td><%=Rs.getFloat("contract_ton")%></td>
              		<td><%=Rs.getFloat("sample_kgs")%></td>
					<%
						String AppRej = "-";
						if (Rs.getInt("approved_reject")==1) AppRej = "Approved";
						if (Rs.getInt("approved_reject")==2) AppRej = "Rejected";
					%>
              		<td><%=AppRej%></td>
              		<td><%=Rs.getString("controller")%></td>
              		<td><%=Utils.dateToStr(Rs.getDate("approved_reject_date"))%></td>
              		<td><%=Rs.getString("remarks")%></td>
              		<td><%=Rs.getInt("confirm")%></td>

<%

				}
			}
			else
			{			
%>			
            <tr>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
<%
			}
%>			
          </table></td>
          </tr>
        <tr>
          <td width="1%"><img src="images/new.gif" width="15" height="15" onClick="new_sample_quality_dts('1');"></td>
          <td width="12%">&nbsp;</td>
          <td width="1%">&nbsp;</td>
          <td width="23%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
        </tr>
      </table></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><span class="style6">Pre-Ship / Delivery </span></td>
      <td>&nbsp;</td>
      <td colspan="3">&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
            <td colspan="7"><table width="100%"  border="0.5" cellspacing="0" cellpadding="0">
        <tr>
          <td colspan="11"><table width="100%"  border="1" cellspacing="0" cellpadding="0">
            <tr align="center" bgcolor="#DDDDDD">
            <tr align="center" bgcolor="#DDDDDD">
              <td width="3%" class="style6">Id</td>
              <td width="7%" height="27" class="style6">Location</td>
              <td width="6%" class="style6">Contract No </td>
              <td width="6%" class="style6">Buyer No </td>
              <td width="6%" class="style6">Lot No </td>
              <td width="6%"><span class="style6">Origin</span></td>
              <td width="6%"><span class="style6">Quality</span></td>
              <td width="16%"><span class="style6">Grade</span></td>
              <td width="5%"><span class="style6">Tons</span></td>
              <td width="4%"><span class="style6">Sample Kg </span></td>
              <td width="5%"><span class="style6">App/Rej</span></td>
              <td width="7%"><span class="style6">Controller</span></td>
              <td width="7%"><span class="style6">Date</span></td>
              <td width="11%"><span class="style6">Remarks</span></td>
              <td width="5%"><span class="style6">Confirm</span></td>
            </tr>
<%
			dLoop=0;
			Rs = task.fetchSampleCategoryList(2);
			Rs.beforeFirst();
			if (Rs.next()==true)
			{
				Rs.beforeFirst();
				while (Rs.next())
				{
%>
            	<tr class="style7">
              		<td><%=Rs.getInt("id")%></td>
              		<td><%=Rs.getString("location")%></td>
              		<td><%=Rs.getString("contract_ref_no")%></td>
              		<td><%=Rs.getString("buyer_ref_no")%></td>
              		<td><%=Rs.getString("wn_ref_no")%></td>
              		<td><%=task.getFieldValueForId("origin_master","name",Rs.getInt("origin_id"))%></td>
              		<td><%=task.getFieldValueForId("quality_master","name",Rs.getInt("quality_id"))%></td>
              		<td><%=task.getFieldValueForId("grade_master","name",Rs.getInt("grade_id"))%></td>
              		<td><%=Rs.getFloat("contract_ton")%></td>
              		<td><%=Rs.getFloat("sample_kgs")%></td>
					<%
						String AppRej = "-";
						if (Rs.getInt("approved_reject")==1) AppRej = "Approved";
						if (Rs.getInt("approved_reject")==2) AppRej = "Rejected";
					%>
              		<td><%=AppRej%></td>
              		<td><%=Rs.getString("controller")%></td>
              		<td><%=Utils.dateToStr(Rs.getDate("approved_reject_date"))%></td>
              		<td><%=Rs.getString("remarks")%></td>
              		<td><%=Rs.getInt("confirm")%></td>

<%

				}
			}
			else
			{			
%>			
            <tr>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
<%
			}
%>			
          </table></td>
          </tr>
        <tr>
          <td width="1%"><img src="images/new.gif" width="15" height="15" onClick="new_sample_quality_dts(2)"></td>
          <td width="12%">&nbsp;</td>
          <td width="1%">&nbsp;</td>
          <td width="23%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
        </tr>
      </table></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><span class="style6">Shipping</span></td>
      <td>&nbsp;</td>
      <td colspan="3">&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
            <td colspan="7"><table width="100%"  border="0.5" cellspacing="0" cellpadding="0">
        <tr>
          <td colspan="11"><table width="100%"  border="1" cellspacing="0" cellpadding="0">
            <tr align="center" bgcolor="#DDDDDD">
            <tr align="center" bgcolor="#DDDDDD">
              <td width="3%" class="style6">Id</td>
              <td width="7%" height="27" class="style6">Location</td>
              <td width="6%" class="style6">Contract No </td>
              <td width="6%" class="style6">Buyer No </td>
              <td width="6%" class="style6">Lot No </td>
              <td width="6%"><span class="style6">Origin</span></td>
              <td width="6%"><span class="style6">Quality</span></td>
              <td width="16%"><span class="style6">Grade</span></td>
              <td width="5%"><span class="style6">Tons</span></td>
              <td width="4%"><span class="style6">Sample Kg </span></td>
              <td width="5%"><span class="style6">App/Rej</span></td>
              <td width="7%"><span class="style6">Controller</span></td>
              <td width="7%"><span class="style6">Date</span></td>
              <td width="11%"><span class="style6">Remarks</span></td>
              <td width="5%" class="style6">Confirm</td>
            </tr>
<%
			dLoop=0;
			Rs = task.fetchSampleCategoryList(3);
			Rs.beforeFirst();
			if (Rs.next()==true)
			{
				Rs.beforeFirst();
				while (Rs.next())
				{
%>
            	<tr class="style7">
              		<td><%=Rs.getInt("id")%></td>
              		<td><%=Rs.getString("location")%></td>
              		<td><%=Rs.getString("contract_ref_no")%></td>
              		<td><%=Rs.getString("buyer_ref_no")%></td>
              		<td><%=Rs.getString("wn_ref_no")%></td>
              		<td><%=task.getFieldValueForId("origin_master","name",Rs.getInt("origin_id"))%></td>
              		<td><%=task.getFieldValueForId("quality_master","name",Rs.getInt("quality_id"))%></td>
              		<td><%=task.getFieldValueForId("grade_master","name",Rs.getInt("grade_id"))%></td>
              		<td><%=Rs.getFloat("contract_ton")%></td>
              		<td><%=Rs.getFloat("sample_kgs")%></td>
					<%
						String AppRej = "-";
						if (Rs.getInt("approved_reject")==1) AppRej = "Approved";
						if (Rs.getInt("approved_reject")==2) AppRej = "Rejected";
					%>
              		<td><%=AppRej%></td>
              		<td><%=Rs.getString("controller")%></td>
              		<td><%=Utils.dateToStr(Rs.getDate("approved_reject_date"))%></td>
              		<td><%=Rs.getString("remarks")%></td>
              		<td><%=Rs.getInt("confirm")%></td>

<%

				}
			}
			else
			{			
%>			
            <tr>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
<%
			}
%>			
          </table></td>
          </tr>
        <tr>
          <td width="1%"><img src="images/new.gif" width="15" height="15" onClick="new_sample_quality_dts(3)"></td>
          <td width="12%">&nbsp;</td>
          <td width="1%">&nbsp;</td>
          <td width="23%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
        </tr>
      </table></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><span class="style6">Stock</span></td>
      <td>&nbsp;</td>
      <td colspan="3">&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
            <td colspan="7"><table width="100%"  border="0.5" cellspacing="0" cellpadding="0">
        <tr>
          <td colspan="11"><table width="100%"  border="1" cellspacing="0" cellpadding="0">
            <tr align="center" bgcolor="#DDDDDD">
            <tr align="center" bgcolor="#DDDDDD">
              <td width="3%" class="style6">Id</td>
              <td width="7%" height="27" class="style6">Location</td>
              <td width="6%" class="style6">Contract No </td>
              <td width="6%" class="style6">Buyer No </td>
              <td width="6%" class="style6">Lot No </td>
              <td width="6%"><span class="style6">Origin</span></td>
              <td width="6%"><span class="style6">Quality</span></td>
              <td width="16%"><span class="style6">Grade</span></td>
              <td width="5%"><span class="style6">Tons</span></td>
              <td width="4%"><span class="style6">Sample Kg </span></td>
              <td width="5%"><span class="style6">App/Rej</span></td>
              <td width="7%"><span class="style6">Controller</span></td>
              <td width="7%"><span class="style6">Date</span></td>
              <td width="11%"><span class="style6">Remarks</span></td>
              <td width="5%" class="style6">Confirm</td>
            </tr>
<%
			dLoop=0;
			Rs = task.fetchSampleCategoryList(4);
			Rs.beforeFirst();
			if (Rs.next()==true)
			{
				Rs.beforeFirst();
				while (Rs.next())
				{
%>
            	<tr class="style7">
              		<td><%=Rs.getInt("id")%></td>
              		<td><%=Rs.getString("location")%></td>
              		<td><%=Rs.getString("contract_ref_no")%></td>
              		<td><%=Rs.getString("buyer_ref_no")%></td>
              		<td><%=Rs.getString("wn_ref_no")%></td>
              		<td><%=task.getFieldValueForId("origin_master","name",Rs.getInt("origin_id"))%></td>
              		<td><%=task.getFieldValueForId("quality_master","name",Rs.getInt("quality_id"))%></td>
              		<td><%=task.getFieldValueForId("grade_master","name",Rs.getInt("grade_id"))%></td>
              		<td><%=Rs.getFloat("contract_ton")%></td>
              		<td><%=Rs.getFloat("sample_kgs")%></td>
					<%
						String AppRej = "-";
						if (Rs.getInt("approved_reject")==1) AppRej = "Approved";
						if (Rs.getInt("approved_reject")==2) AppRej = "Rejected";
					%>
              		<td><%=AppRej%></td>
              		<td><%=Rs.getString("controller")%></td>
              		<td><%=Utils.dateToStr(Rs.getDate("approved_reject_date"))%></td>
              		<td><%=Rs.getString("remarks")%></td>
              		<td><%=Rs.getInt("confirm")%></td>

<%

				}
			}
			else
			{			
%>			
            <tr>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
<%
			}
%>			
          </table></td>
          </tr>
        <tr>
          <td width="1%"><img src="images/new.gif" width="15" height="15" onClick="new_sample_quality_dts(4)"></td>
          <td width="12%">&nbsp;</td>
          <td width="1%">&nbsp;</td>
          <td width="23%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
        </tr>
      </table></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td colspan="5"><span class="style6">Reference / Offer / Type</span></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
            <td colspan="7"><table width="100%"  border="0.5" cellspacing="0" cellpadding="0">
        <tr>
          <td colspan="11"><table width="100%"  border="1" cellspacing="0" cellpadding="0">
            <tr align="center" bgcolor="#DDDDDD">
            <tr align="center" bgcolor="#DDDDDD">
              <td width="3%" class="style6">Id</td>
              <td width="7%" height="27" class="style6">Location</td>
              <td width="6%" class="style6">Contract No </td>
              <td width="6%" class="style6">Buyer No </td>
              <td width="6%" class="style6">Lot No </td>
              <td width="6%"><span class="style6">Origin</span></td>
              <td width="6%"><span class="style6">Quality</span></td>
              <td width="16%"><span class="style6">Grade</span></td>
              <td width="5%"><span class="style6">Tons</span></td>
              <td width="4%"><span class="style6">Sample Kg </span></td>
              <td width="5%"><span class="style6">App/Rej</span></td>
              <td width="7%"><span class="style6">Controller</span></td>
              <td width="7%"><span class="style6">Date</span></td>
              <td width="11%"><span class="style6">Remarks</span></td>
              <td width="5%" class="style6">Confirm</td>
            </tr>
<%
			dLoop=0;
			Rs = task.fetchSampleCategoryList(5);
			Rs.beforeFirst();
			if (Rs.next()==true)
			{
				Rs.beforeFirst();
				while (Rs.next())
				{
%>
            	<tr class="style7">
              		<td><%=Rs.getInt("id")%></td>
              		<td><%=Rs.getString("location")%></td>
              		<td><%=Rs.getString("contract_ref_no")%></td>
              		<td><%=Rs.getString("buyer_ref_no")%></td>
              		<td><%=Rs.getString("wn_ref_no")%></td>
              		<td><%=task.getFieldValueForId("origin_master","name",Rs.getInt("origin_id"))%></td>
              		<td><%=task.getFieldValueForId("quality_master","name",Rs.getInt("quality_id"))%></td>
              		<td><%=task.getFieldValueForId("grade_master","name",Rs.getInt("grade_id"))%></td>
              		<td><%=Rs.getFloat("contract_ton")%></td>
              		<td><%=Rs.getFloat("sample_kgs")%></td>
					<%
						String AppRej = "-";
						if (Rs.getInt("approved_reject")==1) AppRej = "Approved";
						if (Rs.getInt("approved_reject")==2) AppRej = "Rejected";
					%>
              		<td><%=AppRej%></td>
              		<td><%=Rs.getString("controller")%></td>
              		<td><%=Utils.dateToStr(Rs.getDate("approved_reject_date"))%></td>
              		<td><%=Rs.getString("remarks")%></td>
              		<td><%=Rs.getInt("confirm")%></td>

<%

				}
			}
			else
			{			
%>			
            <tr>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
<%
			}
%>			
          </table></td>
          </tr>
        <tr>
          <td width="1%"><img src="images/new.gif" width="15" height="15" onClick="new_sample_quality_dts(5)"></td>
          <td width="12%">&nbsp;</td>
          <td width="1%">&nbsp;</td>
          <td width="23%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
          <td width="9%">&nbsp;</td>
        </tr>
      </table></td>
	</tr>
    <tr>
      <td colspan="2">&nbsp;</td>
      <td>&nbsp;</td>
      <td colspan="3">&nbsp;</td>
      <td align="right"><img src="images/listview.jpg" width="55" height="18" onClick="doListView()"></td>
    </tr>
    <tr>
      <td colspan="2">&nbsp;</td>
      <td>&nbsp;</td>
      <td colspan="3">&nbsp;</td>
      <td>&nbsp;</td>
    </tr>

          </table></td>
        </tr>
      </table></td>
    </tr>
    <tr>
      <td width="12%">&nbsp;</td>
      <td width="88%">&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
  </table>
</form>
<%@include file="../footer.jsp"%>
